<template>
  <el-dropdown style="margin-left: auto; margin-right: 30px">
    <div
      style="
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: default;
      "
    >
      <el-avatar />
      <i
        style="
          font-size: 14px;
          color: black;
          margin-left: 10px;
          user-select: none;
        "
        >admin</i
      >
    </div>
    <template #dropdown>
      <el-dropdown-menu>
        <el-dropdown-item>个人中心</el-dropdown-item>
        <el-dropdown-item>安全管理</el-dropdown-item>
        <el-dropdown-item @click="logout">退出登录</el-dropdown-item>
      </el-dropdown-menu>
    </template>
  </el-dropdown>
</template>

<script setup>
// 退出登录
function logout() {
  localStorage.removeItem('token')
  window.location.reload()
}
</script>

<style scoped></style>
